package com.d3works.csv.script;

import com.d3works.apps.base.db.Year;
import com.d3works.apps.base.service.YearService;
import com.d3works.exception.D3worksException;
import com.google.inject.Inject;
import java.util.Map;

public class ImportYear {

  @Inject protected YearService yearService;

  public Object importYear(Object bean, Map<String, Object> values) throws D3worksException {
    Year year = (Year) bean;
    year.getPeriodList().addAll(yearService.generatePeriods(year));
    return year;
  }
}
